﻿using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;
using KaytechSoftware.Cms.Services.Interfaces.Entity;
using KaytechSoftware.Cms.Services.Interfaces.Miscellaneous;
using KaytechSoftware.Cms.Services.Services.Entity;
using KaytechSoftware.Cms.Services.Services.Miscellaneous;

namespace KaytechSoftware.Cms.Services
{
    public class ServiceInstaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(Component.For(typeof(IPageService)).ImplementedBy(typeof(PageService)).LifestylePerWebRequest(),
                               Component.For(typeof(ILeftSideRendererService)).ImplementedBy(typeof(LeftSideRendererService)).LifestylePerWebRequest(),
                               Component.For(typeof(IRightSideRendererService)).ImplementedBy(typeof(RightSideRendererService)).LifestylePerWebRequest(),
                               Component.For(typeof(INewsService)).ImplementedBy(typeof(NewsService)).LifestylePerWebRequest(),
                               Component.For(typeof(IPhotoAlbumService)).ImplementedBy(typeof(PhotoAlbumService)).LifestylePerWebRequest(),
                               Component.For(typeof(IPhotoService)).ImplementedBy(typeof(PhotoService)).LifestylePerWebRequest(),
                               Component.For(typeof(IImageService)).ImplementedBy(typeof(ImageService)).LifestylePerWebRequest());
        }
    }
}
